import java.math.BigInteger;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.fisco.bcos.sdk.abi.FunctionReturnDecoder;
import org.fisco.bcos.sdk.abi.TypeReference;
import org.fisco.bcos.sdk.abi.datatypes.Address;
import org.fisco.bcos.sdk.abi.datatypes.Bool;
import org.fisco.bcos.sdk.abi.datatypes.Function;
import org.fisco.bcos.sdk.abi.datatypes.Type;
import org.fisco.bcos.sdk.abi.datatypes.Utf8String;
import org.fisco.bcos.sdk.abi.datatypes.generated.Uint256;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple11;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple4;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple8;
import org.fisco.bcos.sdk.client.Client;
import org.fisco.bcos.sdk.contract.Contract;
import org.fisco.bcos.sdk.crypto.CryptoSuite;
import org.fisco.bcos.sdk.crypto.keypair.CryptoKeyPair;
import org.fisco.bcos.sdk.model.CryptoType;
import org.fisco.bcos.sdk.model.TransactionReceipt;
import org.fisco.bcos.sdk.model.callback.TransactionCallback;
import org.fisco.bcos.sdk.transaction.model.exception.ContractException;

@SuppressWarnings("unchecked")
public class EmploymentContractManager extends Contract {
    public static final String[] BINARY_ARRAY = {"608060405234801561001057600080fd5b50612071806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80635b694fd014610051578063793152d31461006d578063bfafff5b1461009d578063ef4b6753146100d0575b600080fd5b61006b60048036038101906100669190611933565b61010a565b005b61008760048036038101906100829190611a45565b610453565b6040516100949190611da9565b60405180910390f35b6100b760048036038101906100b29190611a45565b6108f0565b6040516100c79493929190611dc4565b60405180910390f35b6100ea60048036038101906100e59190611a45565b611299565b6040516101019b9a99989796959493929190611cdb565b60405180910390f35b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16141561017a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017190611e17565b60405180910390fd5b600087116101bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101b490611e97565b60405180910390fd5b84861115610200576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101f790611e37565b60405180910390fd5b600042898560405160200161021793929190611ca2565b604051602081830303815290604052805190602001209050606061023d8260001c61164e565b9050610247611788565b6040518061016001604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018c73ffffffffffffffffffffffffffffffffffffffff1681526020018b81526020018a8152602001898152602001888152602001878152602001868152602001858152602001838152602001600115158152509050806000836040516102d59190611c8b565b908152602001604051809103902060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020155606082015181600301556080820151816004015560a08201518160050190805190602001906103ab929190611810565b5060c08201518160060190805190602001906103c8929190611810565b5060e08201518160070190805190602001906103e5929190611810565b50610100820151816008019080519060200190610403929190611810565b50610120820151816009019080519060200190610421929190611810565b5061014082015181600a0160006101000a81548160ff0219169083151502179055509050505050505050505050505050565b600061045d611788565b60008360405161046d9190611c8b565b9081526020016040518091039020604051806101600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282015481526020016003820154815260200160048201548152602001600582018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105ea5780601f106105bf576101008083540402835291602001916105ea565b820191906000526020600020905b8154815290600101906020018083116105cd57829003601f168201915b50505050508152602001600682018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561068c5780601f106106615761010080835404028352916020019161068c565b820191906000526020600020905b81548152906001019060200180831161066f57829003601f168201915b50505050508152602001600782018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561072e5780601f106107035761010080835404028352916020019161072e565b820191906000526020600020905b81548152906001019060200180831161071157829003601f168201915b50505050508152602001600882018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107d05780601f106107a5576101008083540402835291602001916107d0565b820191906000526020600020905b8154815290600101906020018083116107b357829003601f168201915b50505050508152602001600982018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108725780601f1061084757610100808354040283529160200191610872565b820191906000526020600020905b81548152906001019060200180831161085557829003601f168201915b50505050508152602001600a820160009054906101000a900460ff161515151581525050905060008161012001515114156108e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d990611e57565b60405180910390fd5b806101400151915050919050565b606080600080846108ff611788565b60008260405161090f9190611c8b565b9081526020016040518091039020604051806101600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282015481526020016003820154815260200160048201548152602001600582018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a8c5780601f10610a6157610100808354040283529160200191610a8c565b820191906000526020600020905b815481529060010190602001808311610a6f57829003601f168201915b50505050508152602001600682018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b2e5780601f10610b0357610100808354040283529160200191610b2e565b820191906000526020600020905b815481529060010190602001808311610b1157829003601f168201915b50505050508152602001600782018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bd05780601f10610ba557610100808354040283529160200191610bd0565b820191906000526020600020905b815481529060010190602001808311610bb357829003601f168201915b50505050508152602001600882018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c725780601f10610c4757610100808354040283529160200191610c72565b820191906000526020600020905b815481529060010190602001808311610c5557829003601f168201915b50505050508152602001600982018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d145780601f10610ce957610100808354040283529160200191610d14565b820191906000526020600020905b815481529060010190602001808311610cf757829003601f168201915b50505050508152602001600a820160009054906101000a900460ff1615151515815250509050806000015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610da75750806020015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610de6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ddd90611e77565b60405180910390fd5b610dee611788565b600088604051610dfe9190611c8b565b9081526020016040518091039020604051806101600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282015481526020016003820154815260200160048201548152602001600582018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f7b5780601f10610f5057610100808354040283529160200191610f7b565b820191906000526020600020905b815481529060010190602001808311610f5e57829003601f168201915b50505050508152602001600682018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561101d5780601f10610ff25761","010080835404028352916020019161101d565b820191906000526020600020905b81548152906001019060200180831161100057829003601f168201915b50505050508152602001600782018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110bf5780601f10611094576101008083540402835291602001916110bf565b820191906000526020600020905b8154815290600101906020018083116110a257829003601f168201915b50505050508152602001600882018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111615780601f1061113657610100808354040283529160200191611161565b820191906000526020600020905b81548152906001019060200180831161114457829003601f168201915b50505050508152602001600982018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112035780601f106111d857610100808354040283529160200191611203565b820191906000526020600020905b8154815290600101906020018083116111e657829003601f168201915b50505050508152602001600a820160009054906101000a900460ff16151515158152505090506000816101200151511415611273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126a90611e57565b60405180910390fd5b8060a001518160c001518260600151836080015196509650965096505050509193509193565b6000818051602081018201805184825260208301602085012081835280955050505050506000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806002015490806003015490806004015490806005018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113b95780601f1061138e576101008083540402835291602001916113b9565b820191906000526020600020905b81548152906001019060200180831161139c57829003601f168201915b505050505090806006018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114575780601f1061142c57610100808354040283529160200191611457565b820191906000526020600020905b81548152906001019060200180831161143a57829003601f168201915b505050505090806007018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114f55780601f106114ca576101008083540402835291602001916114f5565b820191906000526020600020905b8154815290600101906020018083116114d857829003601f168201915b505050505090806008018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115935780601f1061156857610100808354040283529160200191611593565b820191906000526020600020905b81548152906001019060200180831161157657829003601f168201915b505050505090806009018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116315780601f1061160657610100808354040283529160200191611631565b820191906000526020600020905b81548152906001019060200180831161161457829003601f168201915b50505050509080600a0160009054906101000a900460ff1690508b565b60606000821415611696576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050611783565b600082905060005b600082146116c0578080600101915050600a82816116b857fe5b04915061169e565b60608167ffffffffffffffff811180156116d957600080fd5b506040519080825280601f01601f19166020018201604052801561170c5781602001600182028036833780820191505090505b5090505b6000851461177c57600182039150600a858161172857fe5b0660300160f81b81838151811061173b57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a858161177457fe5b049450611710565b8093505050505b919050565b604051806101600160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160608152602001606081526020016060815260200160608152602001606081526020016000151581525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061185157805160ff191683800117855561187f565b8280016001018555821561187f579182015b8281111561187e578251825591602001919060010190611863565b5b50905061188c9190611890565b5090565b6118b291905b808211156118ae576000816000905550600101611896565b5090565b90565b6000813590506118c48161200d565b92915050565b600082601f8301126118db57600080fd5b81356118ee6118e982611ee4565b611eb7565b9150808252602083016020830185838301111561190a57600080fd5b611915838284611f7f565b50505092915050565b60008135905061192d81612024565b92915050565b600080600080600080600080610100898b03121561195057600080fd5b600061195e8b828c016118b5565b985050602061196f8b828c0161191e565b97505060406119808b828c0161191e565b96505060606119918b828c0161191e565b955050608089013567ffffffffffffffff8111156119ae57600080fd5b6119ba8b828c016118ca565b94505060a089013567ffffffffffffffff8111156119d757600080fd5b6119e38b828c016118ca565b93505060c089013567ffffffffffffffff811115611a0057600080fd5b611a0c8b828c016118ca565b92505060e089013567ffffffffffffffff811115611a2957600080fd5b611a358b828c016118ca565b9150509295985092959890939650565b600060208284031215611a5757600080fd5b600082013567ffffffffffffffff811115611a7157600080fd5b611a7d848285016118ca565b91505092915050565b611a8f81611f37565b82525050565b611aa6611aa182611f37565b611fc1565b82525050565b611ab581611f49565b82525050565b6000611ac682611f10565b611ad08185611f1b565b9350611ae0818560208601611f8e565b611ae981611fef565b840191505092915050565b6000611aff82611f10565b611b098185611f2c565b9350611b19818560208601611f8e565b80840191505092915050565b6000611b32601883611f1b565b91507f496e76616c696420656d706c6f796565206164647265737300000000000000006000830152602082019050919050565b6000611b72601183611f1b565b91507f496e76616c6964207374617274646174650000000000000000000000000000006000830152602082019050919050565b6000611bb2601283611f1b565b91507f436f6e7472616374206e6f7420666f756e6400000000000000000000000000006000830152602082019050919050565b6000611bf2601983611f1b565b91507f4f6e6c7920656d706c6f796572206f7220656d706c6f796565000000000000006000830152602082019050919050565b6000611c32600e83611f1b565b91507f73616c617279206d757374203e300000000000000000000000000000000000006000830152602082019050919050565b611c6e81611f75565b82525050565b611c85611c8082611f75565b611fe5565b82525050565b6000611c978284611af4565b915081905092915050565b6000611cae8286611c74565b602082019150611cbe8285611a95565b601482019150611cce8284611af4565b9150819050949350505050565b600061016082019050611cf1600083018e611a86565b611cfe602083018d611a86565b611d0b604083018c611c65565b611d18606083018b611c65565b611d25608083018a611c65565b81810360a0830152611d378189611abb565b905081810360c0830152611d4b8188611abb565b905081810360e0830152611d5f8187611abb565b9050818103610100830152611d748186611abb565b9050818103610120830152611d898185611abb565b9050611d99610140830184611aac565b9c9b505050505050505050505050565b6000602082019050611dbe6000830184611aac565b92915050565b60006080820190508181036000830152611dde8187611abb565b90508181036020830152611df28186611abb565b9050611e016040830185611c65565b611e0e6060830184611c65565b95945050505050565b60006020820190508181036000830152611e3081611b25565b9050919050565b60006020820190508181036000830152611e5081611b65565b9050919050565b60006020820190508181036000830152611e7081611ba5565b9050919050565b60006020820190508181036000830152611e9081611be5565b9050919050565b60006020820190508181036000830152611eb081611c25565b9050919050565b6000604051905081810181811067ffffffffffffffff82111715611eda57600080fd5b8060405250919050565b600067ffffffffffffffff821115611efb57600080fd5b601f19601f8301169050602081019050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b6000611f4282611f55565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015611fac578082015181840152602081019050611f91565b83811115611fbb576000848401525b50505050565b6000611fcc82611fd3565b9050919050565b6000611fde82612000565b90","50919050565b6000819050919050565b6000601f19601f8301169050919050565b60008160601b9050919050565b61201681611f37565b811461202157600080fd5b50565b61202d81611f75565b811461203857600080fd5b5056fea2646970667358221220e6b00f23ac35ed1d8361981a092c4b8ab8d8010c135a1eb6ea964c49ea9a17f164736f6c634300060a0033"};

    public static final String BINARY = org.fisco.bcos.sdk.utils.StringUtils.joinAll("", BINARY_ARRAY);

    public static final String[] SM_BINARY_ARRAY = {};

    public static final String SM_BINARY = org.fisco.bcos.sdk.utils.StringUtils.joinAll("", SM_BINARY_ARRAY);

    public static final String[] ABI_ARRAY = {"[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_contractHash\",\"type\":\"string\"}],\"name\":\"checkContractStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"name\":\"contractsByHash\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"employer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"employee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"salary\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"startDate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"endDate\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"employeeId\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"companyName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"employeeName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"legalPersonName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"contractHash\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_employee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_salary\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startDate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endDate\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_employeeId\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_companyName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_employeeName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_legalPersonName\",\"type\":\"string\"}],\"name\":\"createContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_contractHash\",\"type\":\"string\"}],\"name\":\"getContractDetails\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]"};

    public static final String ABI = org.fisco.bcos.sdk.utils.StringUtils.joinAll("", ABI_ARRAY);

    public static final String FUNC_CHECKCONTRACTSTATUS = "checkContractStatus";

    public static final String FUNC_CONTRACTSBYHASH = "contractsByHash";

    public static final String FUNC_CREATECONTRACT = "createContract";

    public static final String FUNC_GETCONTRACTDETAILS = "getContractDetails";

    protected EmploymentContractManager(String contractAddress, Client client, CryptoKeyPair credential) {
        super(getBinary(client.getCryptoSuite()), contractAddress, client, credential);
    }

    public static String getBinary(CryptoSuite cryptoSuite) {
        return (cryptoSuite.getCryptoTypeConfig() == CryptoType.ECDSA_TYPE ? BINARY : SM_BINARY);
    }

    public Boolean checkContractStatus(String _contractHash) throws ContractException {
        final Function function = new Function(FUNC_CHECKCONTRACTSTATUS, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_contractHash)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Bool>() {}));
        return executeCallWithSingleValueReturn(function, Boolean.class);
    }

    public Tuple11<String, String, BigInteger, BigInteger, BigInteger, String, String, String, String, String, Boolean> contractsByHash(String param0) throws ContractException {
        final Function function = new Function(FUNC_CONTRACTSBYHASH, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.Utf8String(param0)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}, new TypeReference<Address>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Bool>() {}));
        List<Type> results = executeCallWithMultipleValueReturn(function);
        return new Tuple11<String, String, BigInteger, BigInteger, BigInteger, String, String, String, String, String, Boolean>(
                (String) results.get(0).getValue(), 
                (String) results.get(1).getValue(), 
                (BigInteger) results.get(2).getValue(), 
                (BigInteger) results.get(3).getValue(), 
                (BigInteger) results.get(4).getValue(), 
                (String) results.get(5).getValue(), 
                (String) results.get(6).getValue(), 
                (String) results.get(7).getValue(), 
                (String) results.get(8).getValue(), 
                (String) results.get(9).getValue(), 
                (Boolean) results.get(10).getValue());
    }

    public TransactionReceipt createContract(String _employee, BigInteger _salary, BigInteger _startDate, BigInteger _endDate, String _employeeId, String _companyName, String _employeeName, String _legalPersonName) {
        final Function function = new Function(
                FUNC_CREATECONTRACT, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.Address(_employee), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_salary), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_startDate), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_endDate), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_employeeId), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_companyName), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_employeeName), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_legalPersonName)), 
                Collections.<TypeReference<?>>emptyList());
        return executeTransaction(function);
    }

    public byte[] createContract(String _employee, BigInteger _salary, BigInteger _startDate, BigInteger _endDate, String _employeeId, String _companyName, String _employeeName, String _legalPersonName, TransactionCallback callback) {
        final Function function = new Function(
                FUNC_CREATECONTRACT, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.Address(_employee), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_salary), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_startDate), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_endDate), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_employeeId), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_companyName), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_employeeName), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_legalPersonName)), 
                Collections.<TypeReference<?>>emptyList());
        return asyncExecuteTransaction(function, callback);
    }

    public String getSignedTransactionForCreateContract(String _employee, BigInteger _salary, BigInteger _startDate, BigInteger _endDate, String _employeeId, String _companyName, String _employeeName, String _legalPersonName) {
        final Function function = new Function(
                FUNC_CREATECONTRACT, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.Address(_employee), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_salary), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_startDate), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_endDate), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_employeeId), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_companyName), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_employeeName), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_legalPersonName)), 
                Collections.<TypeReference<?>>emptyList());
        return createSignedTransaction(function);
    }

    public Tuple8<String, BigInteger, BigInteger, BigInteger, String, String, String, String> getCreateContractInput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function = new Function(FUNC_CREATECONTRACT, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}));
        List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple8<String, BigInteger, BigInteger, BigInteger, String, String, String, String>(

                (String) results.get(0).getValue(), 
                (BigInteger) results.get(1).getValue(), 
                (BigInteger) results.get(2).getValue(), 
                (BigInteger) results.get(3).getValue(), 
                (String) results.get(4).getValue(), 
                (String) results.get(5).getValue(), 
                (String) results.get(6).getValue(), 
                (String) results.get(7).getValue()
                );
    }

    public Tuple4<String, String, BigInteger, BigInteger> getContractDetails(String _contractHash) throws ContractException {
        final Function function = new Function(FUNC_GETCONTRACTDETAILS, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_contractHash)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}));
        List<Type> results = executeCallWithMultipleValueReturn(function);
        return new Tuple4<String, String, BigInteger, BigInteger>(
                (String) results.get(0).getValue(), 
                (String) results.get(1).getValue(), 
                (BigInteger) results.get(2).getValue(), 
                (BigInteger) results.get(3).getValue());
    }

    public static EmploymentContractManager load(String contractAddress, Client client, CryptoKeyPair credential) {
        return new EmploymentContractManager(contractAddress, client, credential);
    }

    public static EmploymentContractManager deploy(Client client, CryptoKeyPair credential) throws ContractException {
        return deploy(EmploymentContractManager.class, client, credential, getBinary(client.getCryptoSuite()), "");
    }
}
